CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
PROJECT(NV)

SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")

IF(WIN32)
	# gnuwin32 paths:
	SET(GNUWIN32_PATH "${NV_SOURCE_DIR}/extern/gnuwin32")
	SET(CMAKE_INCLUDE_PATH "${GNUWIN32_PATH}/include")
	IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
	  SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${GNUWIN32_PATH}/lib64")
	ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
	  SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${GNUWIN32_PATH}/lib")
	ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
	
	# Set GLUT path:
	SET(GLUT_ROOT_PATH "${NV_SOURCE_DIR}/extern/glut")

	# Set GLEW path:
	SET(GLEW_ROOT_PATH "${NV_SOURCE_DIR}/src/nvgl/glew")

	IF(MSVC80)
	#	SET(OPENEXR_PATH "${NV_SOURCE_DIR}/openexr/vs2005")
	ENDIF(MSVC80)

	IF(OPENEXR_PATH)
		SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${OPENEXR_PATH}/include")
		SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${OPENEXR_PATH}/lib")
	ENDIF(OPENEXR_PATH)

	ADD_SUBDIRECTORY(${GNUWIN32_PATH})

ENDIF(WIN32)

INCLUDE(${NV_CMAKE_DIR}/OptimalOptions.cmake)
MESSAGE(STATUS "Setting optimal options")
MESSAGE(STATUS "  Processor: ${NV_SYSTEM_PROCESSOR}")
MESSAGE(STATUS "  Compiler Flags: ${CMAKE_CXX_FLAGS}")


ADD_SUBDIRECTORY(src)
